package com.glorious.entities;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Table;

import javax.persistence.Column;
import javax.persistence.Entity;
import java.io.Serializable;
import java.time.LocalDate;

@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("app_user")
@Entity(name = "app_user")
@Table(appliesTo = "app_user", comment = "移动端用户信息表")
@ApiModel("移动端用户信息表")
public class AppUser extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -1853675525261716773L;

    @ApiModelProperty(value = "姓名")
    @Column(columnDefinition = "varchar(255) COMMENT '姓名'")
    private String username;

    @ApiModelProperty(value = "密码")
    @Column(columnDefinition = "varchar(255) COMMENT '密码'")
    private String password;

    @ApiModelProperty(value = "性别 0未知 1女 2男")
    @Column(columnDefinition = "int(1) COMMENT '性别 0未知 1女 2男'")
    private Integer gender;

    @ApiModelProperty(value = "微信名字")
    @Column(columnDefinition = "varchar(255) COMMENT '微信名字'")
    private String nickName;

    @ApiModelProperty(value = "手机号")
    @Column(columnDefinition = "varchar(255) COMMENT '手机号'")
    private String mobile;

    @ApiModelProperty(value = "生日")
    @Column(columnDefinition = "date COMMENT '生日'")
    private LocalDate birthday;

    @ApiModelProperty(value = "微信头像")
    @Column(columnDefinition = "varchar(255) COMMENT '微信头像'")
    private String avatarUrl;

    @ApiModelProperty(value = "openId")
    @Column(columnDefinition = "varchar(255) COMMENT 'openId'")
    private String openId;

    @ApiModelProperty(value = "appid")
    @Column(columnDefinition = "varchar(255) COMMENT 'appid'")
    private String appid;

    @ApiModelProperty(value = "微信会话key")
    @Column(columnDefinition = "varchar(255) COMMENT '微信会话key'")
    private String sessionKey;

    @ApiModelProperty(value = "微信唯一标识id")
    @Column(columnDefinition = "varchar(255) COMMENT '微信唯一标识id'")
    private String unionId;

    @ApiModelProperty(value = "用户状态")
    @Column(columnDefinition = "int(5) COMMENT '用户状态'")
    private Integer status;

    @ApiModelProperty(value = "语言")
    @Column(columnDefinition = "varchar(255) COMMENT '语言'")
    private String language;

    @ApiModelProperty(value = "省")
    @Column(columnDefinition = "varchar(255) COMMENT '省'")
    private String province;

    @ApiModelProperty(value = "城市")
    @Column(columnDefinition = "varchar(255) COMMENT '城市'")
    private String city;

    @ApiModelProperty(value = "区")
    @Column(columnDefinition = "varchar(255) COMMENT '区'")
    private String country;

    @ApiModelProperty(value = "用户类型，0：小程序用户，1：app用户")
    @Column(columnDefinition = "int(1) default '0' COMMENT '用户类型，0：小程序用户，1：app用户'")
    private Integer userType;

}
